<html>
<head>
</head>
<body>
	<?php
		require_once('/Database/Database.php');

		if(isset($_GET['project']) && !isset($_SESSION['projectID'])) {
			$db = new Database();
			$projects =  $db->query('SELECT * FROM ' . $db->projectsTable . ' WHERE ShortName = "' . $_GET['project'] . '"');
			$_SESSION['projectID'] = $projects[0]['ID'];
			$db->disconnect();
		}

		require_once('/Controllers/Controller.php');
		require_once('/Controllers/' . $_GET['controller'] . 'Controller.php');
		$reflection = new ReflectionClass($_GET['controller'] . 'Controller');
		$controller = $reflection->newInstance();
		call_user_func(array($controller, $_GET['action']));
	?>
</body>
</html>